package com.springboot.chongwu.controller.app;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.springboot.chongwu.entity.Jibing;
import com.springboot.chongwu.entity.Zhixun;
import com.springboot.chongwu.qpage.QPage;
import com.springboot.chongwu.service.IZhixunService;
import com.springboot.chongwu.util.ResultView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * 咨询表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-09-27
 */
@RestController
@RequestMapping("/api/front/zhixun")
public class AppZhixunController {


    @Autowired
    private IZhixunService service;


    /**
     * 获取医生咨询
     * @return
     */
    @GetMapping("/getSelect")
    public ResultView getSelect() {
        QueryWrapper<Zhixun> queryWrapper=new QueryWrapper<>();
        List<Zhixun> sysJydzList=this.service.list(queryWrapper);
        return ResultView.ok(sysJydzList);
    }

    /**
     * 根据ID获取当前数据
     * @return
     */
    @GetMapping("/getById")
    public ResultView getById(@NotNull(message = "ID不能为空") String id) {
        return ResultView.ok(this.service.getById(id));
    }


}
